using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using SailHero.Soft.FrameWork.Models;

namespace SailHero.Soft.FrameWork.Mapping.HJT212DB
{
    public class PointParameMap : EntityTypeConfiguration<PointParame>
    {
        public PointParameMap()
        {
            // Primary Key
            this.HasKey(t => new { t.P_ID, t.ParamID });

            // Properties
            this.Property(t => t.P_ID)
                .IsRequired()
                .HasMaxLength(36);

            this.Property(t => t.ParamID)
                .IsRequired()
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("PointParame");
            this.Property(t => t.P_ID).HasColumnName("P_ID");
            this.Property(t => t.ParamID).HasColumnName("ParamID");
            this.Property(t => t.IsAvailably).HasColumnName("IsAvailably");
            this.Property(t => t.Max).HasColumnName("Max");
            this.Property(t => t.Min).HasColumnName("Min");
        }
    }
}
